const http = uni.$u.http;

/* 笔记列表 */
export const init_noteList = async (data) => {
  const res = await http.post("/frontend/note/frontendList", data);
  return res?.data || [];
};

/* 背景图  */
export const init_backgroundList = async (id) => {
  const res = await http.get(`/frontend/background/getBackgroundById?id=${id}`);
  return res?.data || [];
};

/* 笔记详情  */
export const init_noteDetails = async (noteId) => {
  const res = await http.get(`frontend/note/getNodeById?id=${noteId}`);
  return res?.data || [];
};

/* 我的收藏  */
export const init_noteCollec = async (data) => {
  const res = await http.post(`/frontend/note/frontendMyNoteList`, data);
  return res?.data || [];
};

/* 喜欢  */
export const init_updateLike = async (data) => {
  const res = await http.post(`/frontend/noteCollect/updateLike`, data);
  return res?.data || [];
};

/* 收藏  */
export const init_noteCollect = async (data) => {
  const res = await http.post(`/frontend/noteCollect/updateCollect`, data);
  return res?.data || [];
};

/* 收藏  */
export const init_noteTypeMenu = async () => {
  const res = await http.get(`/frontend/note/getNoteTypeMenu`);
  return res?.data || [];
};

/* 添加评价  */
export const init_addComment = async (data) => {
  const res = await http.post(`/frontend/comment/addComment`, data);
  return res?.data || [];
};

/* 评价列表  */
export const init_frontendList = async (data) => {
  const res = await http.post(`/frontend/comment/frontendList`, data);
  return res?.data || [];
};

/* 评价分析  */
export const init_commentAnalysis = async (goodId) => {
  const res = await http.get(`/frontend/comment/commentAnalysis?goodsId=${goodId}`);
  return res?.data || [];
};

/* 笔记标题  */
export const init_nodeContext = async (data) => {
  const res = await http.get(`/frontend/nodeContext/getNodeContext`, data);
  return res?.data || [];
};
/* 首页笔记列表  */
export const init_frontendNoteList = async (data) => {
  const res = await http.get(`/frontend/note/frontendNoteList`, data);
  return res?.data || [];
};
